<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
	</head>
	<body>
		<a href="//www.baidu.com" id="baidu">百度</a>
		<div>这是段落中的 <b>粗体</b> 文本</div>
		<p id="p1">名称：<input type="text" id="name" value="菜鸟教程" /></p>
		<button id="button1">text</button>
		<button id="button2">HTML</button>
		<button id="button3">val</button>
		<button id="button4">百度</button>
		<script type="text/javascript">
			$(function(){
				$("#button1").click(function(){
					alert("text:"+$("div").text());
				})
				$("#button2").click(function(){
					alert("html:"+$("div").html());
				})
				$("#button3").click(function(){
					alert("名称:"+$("#name").val());
				})
				$("#button4").click(function(){
					$("#baidu").attr("href","//cf.qq.com/main.shtml");
				})
			})
		</script>
	</body>
</html>
